package cn.edu.anan.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RetryRule;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * 消费者配置类
 *
 * @author ThinkPad
 * @version 1.0
 * @date 2021/7/31 21:09
 */
@Configuration
public class ConsumerConfiguration {

    @Bean
    @LoadBalanced
    public RestTemplate createRestTemplate(){

        return new RestTemplate();
    }

    @Bean
    public IRule createRule(){
        return new RetryRule();
    }

}
